package myboot.myblog.utils;

import lombok.Data;

import java.util.List;

/**
 * 返回浏览器结果工具类
 * @author hujh
 */
@Data
public class PageResult {

    /**
     * 当前页
     */
    private Integer currPage;
    /**
     * 总页数
     */
    private Integer totalPage;
    /**
     * 页面大小
     */
    private Integer pageSize;
    /**
     * 总记录数
     */
    private Integer totalCount;
    /**
     * 数据列表
     */
    private List<?> list;

    public PageResult(Integer currPage, Integer pageSize, Integer totalCount, List<?> list) {
        this.currPage = currPage;
        this.pageSize = pageSize;
        this.totalCount = totalCount;
        this.list = list;
        this.totalPage = (totalCount / pageSize) + 1;
    }

}
